﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HospitalTracking.Interfaces;
using HospitalTracking.Model;
using System.Collections.ObjectModel;

namespace HospitalTracking.Design
{
    public class DesignHospitalService : IHospitalService
    {
        public void GetHospitalData(Action<Model.Hospital, Exception> callback)
        {
            ObservableCollection<string> meds = new ObservableCollection<string>();
            for (int i = 0; i < 5; i++)
            {
                meds.Add("med " + i);
            }

            ObservableCollection<Treatment> treatments = new ObservableCollection<Treatment>();
            for (int i = 0; i < 3; i++)
            {
                treatments.Add(new Treatment("Treatment " + i, DateTime.MinValue, "Description For this Treatment " + i, "Owner " + i));
            }

            ObservableCollection<Patient> patients = new ObservableCollection<Patient>();
            for (int i = 0; i < 50; i++)
            {
                patients.Add(new Patient("Moshe "+i, "Israeli " + i, String.Format("%09d",i), DateTime.MinValue, 
                    "03-9895421", "Address " + i, DateTime.Now, DateTime.MaxValue, "Description " + i, meds, treatments));
            }
            ObservableCollection<Department> departments = new ObservableCollection<Department>();
            for (int i = 0; i < 10; i++)
            {
                departments.Add(new Department("Department " + i, "this is depratment " + i, patients));
            }
            Hospital hospital = new Hospital("Name", departments);

            callback(hospital, null);
        }


        public void Save(Model.Hospital hospital)
        {
            //throw new NotImplementedException();
        }
    }
}
